home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / PowerPC / Dev / PPCRelease / Examples / Debug / Trap.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-05  |  471 b   |  38 lines

  1. #include <exec/types.h>
  2.  
  3. /* This example should cause an exception in a subroutine
  4.  * The ppc.library`s stackdumb should show the different
  5.  * stack frames which the code created before the exception
  6.  * happened.
  7.  */
  8.  
  9. void    test1(void);
  10.  
  11. void    main(void)
  12. {
  13. //  *((int*) 0x4f000000)    =    0;
  14. //  *((int*) 0x00300000)        =    0;
  15.   test1();
  16. }
  17.  
  18. void    test4(void)
  19. {
  20.   asm("tw 31,0,0");
  21. }
  22.  
  23. void    test3(void)
  24. {
  25.   test4();
  26. }
  27.  
  28. void    test2(void)
  29. {
  30.   test3();
  31. }
  32.  
  33. void    test1(void)
  34. {
  35.   test2();
  36. }
  37.  
  38.